<br/>
<table cellpadding="2" cellspacing="0" border="1" class="formTable" data-sort="sortDisabled">
    <tbody>
        <tr class="firstRow">
            <td colspan="8" class="formHead" width="1479">
                场地围堵_异常上报
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:lcbt">流程标题</span>:
            </td>
            <td style="width:15%;" class="formInput" colspan="3">
                <input type="text" el-component="1" name="m:cdwd:lcbt" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
        </tr>
        <tr>
            <td colspan="8" class="teamHead" width="1479">
                上报信息
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:csycdj">初始异常等级</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <input type="text" el-component="1" name="m:cdwd:csycdj" class="inputText" value="" validate="{maxlength:20}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" width="126">
                <span i18nkey="m:cdwd:ycdj">异常等级</span>:
            </td>
            <td style="width:15%;" class="formInput" width="149">
                <input type="text" el-component="1" name="m:cdwd:ycdj" class="inputText" value="" validate="{maxlength:20}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <!-- <span i18nkey="m:cdwd:zrdq">责任地区</span>: -->
            </td>
            <td style="width:15%;" class="formInput">
                <input type="text" el-component="1" name="m:cdwd:zrdq" class="inputText" value="" validate="{maxlength:20}"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput">
                <input el-component="1" name="m:cdwd:zbID" validate="{maxlength:100,required:false,maxDecimalLen:0}" nodekey="null" class="widget-fragment w-input"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:kssbrgh">快速上报人工号</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <input type="text" el-component="1" name="m:cdwd:kssbrgh" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" width="126">
                <span i18nkey="m:cdwd:kssbrxm">快速上报人姓名</span>:
            </td>
            <td style="width:15%;" class="formInput" width="149">
                <input type="text" el-component="1" name="m:cdwd:kssbrxm" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:kssbrlxfs">快速上报人联系方式</span>:
            </td>
            <td style="width:15%;" class="formInput">
                <input type="text" el-component="1" name="m:cdwd:kssbrlxfs" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:kssbsj">快速上报时间</span>:
            </td>
            <td style="width:15%;" class="formInput">
                <input name="m:cdwd:kssbsj" el-component="17" type="text" class="Wdate" displaydate="0" datefmt="yyyy-MM-dd HH:mm:ss" value="" validate="{}"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:sbrgh">上报人工号</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <input type="text" el-component="1" name="m:cdwd:sbrgh" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" width="126">
                <span i18nkey="m:cdwd:sbrxm">上报人姓名</span>:
            </td>
            <td style="width:15%;" class="formInput" width="149">
                <input type="text" el-component="1" name="m:cdwd:sbrxm" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:sbrlxfs">上报人联系方式</span>:
            </td>
            <td style="width:15%;" class="formInput">
                <input type="text" el-component="1" name="m:cdwd:sbrlxfs" class="inputText" value="" validate="{maxlength:100}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:sbsj">上报时间</span>:
            </td>
            <td style="width: 15%; word-break: break-all;" class="formInput">
                <input name="m:cdwd:sbsj" el-component="17" type="text" class="Wdate" displaydate="0" datefmt="yyyy-MM-dd HH:mm:ss" value="" validate="{}"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" height="0">
                <span i18nkey="m:cdwd:yccldq">异常处理地区</span>:
            </td>
            <td style="width: 15%; word-break: break-all;" class="formInput" height="0" width="0">
                <div>
                    
     
  
 
							<input name="m:cdwd:yccldqPATH" type="hidden" class="hidden" value=""/>
							<input name="m:cdwd:yccldqID" type="hidden" class="hidden" value=""/>
							<input el-component="23" selector-showfield="" name="m:cdwd:yccldq" validate="{}" readonly="" class="widget-fragment w-default" placeholder="选择..."/>
						
                </div>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" height="0" width="126">
                <span i18nkey="m:cdwd:ycclwd">异常处理网点</span>:
            </td>
            <td style="width: 15%; word-break: break-all;" class="formInput" height="0" width="149">
                <div>
                    
     
  
 
							<input name="m:cdwd:ycclwdPATH" type="hidden" class="hidden" value=""/>
							<input name="m:cdwd:ycclwdID" type="hidden" class="hidden" value=""/>
							<input el-component="23" selector-showfield="" name="m:cdwd:ycclwd" validate="{}" readonly="" class="widget-fragment w-default" placeholder="选择..."/>
						
                </div>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" height="0">
                <span i18nkey="m:cdwd:fxsj">发现时间</span>:
            </td>
            <td style="width: 15%; word-break: break-all;" class="formInput" height="0">
                <input el-component="17" name="m:cdwd:fxsj" type="text" readonly="" :default-value="1546833082660" datefmt="yyyy-MM-dd HH:mm:ss" validate="{}" class="widget-fragment w-datetimepicker"/>
            </td>
            <td align="right" style="width:10%;display:none;" class="formTitle" nowrap="nowarp" height="0">
                <span i18nkey="m:cdwd:sfyssb">是否延时上报</span>:
            </td>
            <td style="width:15%;display:none;" class="formInput" height="0">
                <input type="text" el-component="1" name="m:cdwd:sfyssb" class="inputText" value="" validate="{maxlength:20}"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:ycms">异常描述</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <textarea name="m:cdwd:ycms" el-component="2" validate="{}"></textarea>
            </td>
            <td align="right" style="width: 10%; word-break: break-all;" class="formTitle" nowrap="nowarp" width="126"></td>
            <td style="width: 15%; word-break: break-all;" class="formInput" width="149"></td>
            <td style="width: 15%; word-break: break-all; text-align: right;" class="formInput">
                <span i18nkey="m:cdwd:fjxx" style="text-align: -webkit-right; white-space: normal;">附件信息</span><span style="text-align: -webkit-right; white-space: normal; background-color: rgb(250, 250, 250);">:</span>
 
 
 
 
 
   
            </td>
            <td style="width:15%;" class="formInput">
                <input type="file" value="请选择" el-component="12" name="m:cdwd:fjxx" validate="{required:false}" action="http://owsp.sit.sf-express.com/sysFile/upload" class="widget-fragment w-upload"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
        </tr>
        <tr>
            <td colspan="8" class="teamHead" width="1479">
                事件基本信息
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:wdcdlx">围堵场地类型</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <select name="m:cdwd:wdcdlx" el-component="13" validate="{}"><option value=""></option>
                <option value="1">
                    中转场
                </option>
                <option value="3">
                    营业网点
                </option>
                <option value="5">
                    办公场地
                </option>
                <option value="7">
                    场地所在园区
                </option></select>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" width="126">
                <span i18nkey="m:cdwd:fswd">发生网点</span>:
            </td>
            <td style="width:15%;" class="formInput" width="149">
                <input type="text" el-component="1" name="m:cdwd:fswd" class="inputText" value="" validate="{maxlength:200}"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:wdfs">围堵方式</span>:
            </td>
            <td style="width:15%;" class="formInput" width="0">
                <select name="m:cdwd:wdfs" el-component="13" validate="{}"><option value=""></option>
                <option value="1">
                    人员围堵
                </option>
                <option value="3">
                    人车围堵
                </option></select>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp" width="126">
                <span i18nkey="m:cdwd:wdrs">围堵人数</span>:
            </td>
            <td style="width:15%;" class="formInput" width="149">
                <input name="m:cdwd:wdrs" type="text" el-component="1" value="" validate="{number:true,maxIntLen:20,maxDecimalLen:0}"/>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:xcsflhf">现场是否拉横幅</span>:
            </td>
            <td style="width:15%;" class="formInput">
                <select name="m:cdwd:xcsflhf" el-component="13" validate="{}"><option value=""></option>
                <option value="1">
                    是
                </option>
                <option value="3">
                    否
                </option></select>
            </td>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:sfbj">是否报警</span>:
            </td>
            <td style="width:15%;" class="formInput">
                <select name="m:cdwd:sfbj" el-component="13" validate="{}"><option value=""></option>
                <option value="1">
                    是
                </option>
                <option value="3">
                    否
                </option></select>
            </td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:wdyyms">围堵原因描述</span>:
            </td>
            <td style="width:15%;" class="formInput" colspan="3">
                <input type="text" el-component="1" name="m:cdwd:wdyyms" class="inputText" value="" validate="{maxlength:800}"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
        </tr>
        <tr>
            <td align="right" style="width:10%;" class="formTitle" nowrap="nowarp">
                <span i18nkey="m:cdwd:wdrysq">围堵人员诉求</span>:
            </td>
            <td style="width:15%;" class="formInput" colspan="3">
                <input type="text" el-component="1" name="m:cdwd:wdrysq" class="inputText" value="" validate="{maxlength:800}"/>
            </td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
            <td style="width:15%;" class="formInput"></td>
        </tr>
    </tbody>
</table><br/><script>$(function(){

    //上报
    function getParamString() {
            var paramUrl = window.location.search.substr(1);
            var paramStrs = paramUrl.split('&');
            var params = {};
            for(var index = 0; index < paramStrs.length; index++) {
                params[paramStrs[index].split('=')[0]] = decodeURI(paramStrs[index].split('=')[1]);
            }
            return params;
        }
        function setInitData(){
			var urlParams = getParamString();
			var zbID = urlParams['reportRecordId'];
			console.log("reportRecordId " + zbID);
			if($.isNumeric(zbID)){
				FR_MAIN.setData('m:cdwd:zbID', zbID);
				var data = {
					'interfaceAlias':'reportRecordService',
					'p_reportRecordId': zbID
				}
				FR_MAIN.$httpExt().get('/bpm/forwarding/json/get', data).then((response) => {
					console.info(response);
					if(response.result){
						var result = response.result.result;
						var kssbrgh = result.creatorId;//快速上报人工号
						var kssbrxm = result.creatorName||'';//快速上报人姓名
						var kssbrlxfs = result.telPhone||'';//快速上报人联系方式
						var kssbsj = result.reportTime||'';//快速上报时间
						var sbdq = result.reportArea||'';//异常处理地区
						var sbwd = result.reportDept||'';//异常处理网点
						var ycms = result.exceptionDesc||'';//异常描述
						var tpurl = result.pictureUrl;//图片地址
						var yyurl = result.audioUrl;//语言地址
						FR_MAIN.setData('m:cdwd:kssbrgh', kssbrgh);
						FR_MAIN.setData('m:cdwd:kssbrxm', kssbrxm);
						FR_MAIN.setData('m:cdwd:kssbrlxfs', kssbrlxfs);
						FR_MAIN.setData('m:cdwd:kssbsj', kssbsj);
						FR_MAIN.setData('m:cdwd:ycms', ycms);
						setInitAttchment(result);
					}
				}, (response) => {
				    FR_MAIN.$notify.error({
					title: '警告',
					message: '无法获取转报初始化数据'
				    });
				});
			}

		} 	
        function setInitAttchment(result){
				var tpurl = result.pictureUrl;//图片地址
				var yyurl = result.audioUrl;//语言地址
				var data = [];
				if(tpurl){
					var tpPaths = tpurl.split(",");
					for(var i =0; i<tpPaths.length;i++){
						data.push({
							filePath:tpPaths[i]
						});
					}
				}
				if(yyurl){
					var yyPaths = yyurl.split(",");
					for(var i =0; i<yyPaths.length;i++){
						data.push({
							filePath:yyPaths[i]
						});
					}
				}
				FR_MAIN.$httpExt().post('/sysFile/saveFile', data).then((response) =>{
					var result = response.result;
					if(result){
						var formUploadDatas = [];
                      	var fileID = [];
						for(var i =0; i<result.length;i++){
							var fileData = result[i];
                          	var id = fileData.fileId;
							formUploadDatas.push({
								id:id,
								name:fileData.fileName,
								url:'/sysFile/files/'+ id	
							});
                          	fileID.push(id);
						}
						FR_MAIN.$set(FR_MAIN.formUploads, 'm:cdwd:fjxx',formUploadDatas);
                      	FR_MAIN.setData('m:cdwd:fjxx', fileID.join(","));
					}
				}, (response) =>{
				    FR_MAIN.$notify.error({
					title: '警告',
					message: '初始化附件信息错误'
				    });
				})
		}  
		setInitData();
        //格式化时间
        function timeFormat(name){
            var t=FR_MAIN.getData(name).replace(/-/g,'/');
            if(t!=null&&t!=''){
                return new Date(t).format("MM月dd日");
            }else{
                return '';
            }
        }
            //设置流程标题
        function setycbt(){
            //上报时间+异常处理地区+异常处理网点
            var lcbt=timeFormat("m:cdwd:sbsj")+FR_MAIN.getData("m:cdwd:yccldq")+FR_MAIN.getData("m:cdwd:ycclwd");
            FR_MAIN.setData('m:cdwd:lcbt',lcbt);
        }
        //设置初始异常等级
        function setcshycdj(){
            FR_MAIN.setData("m:cdwd:csycdj","三级");
        }
        //是否延时上报
        function setsfyssb(){
            //快速上报时间
            var kssbs = FR_MAIN.getData("m:cdwd:kssbsj").replace(/-/g,'/');
            //上报时间
            var sbsj = FR_MAIN.getData("m:cdwd:sbsj").replace(/-/g,'/');
            //发现时间
            var fxsj = FR_MAIN.getData("m:cdwd:fxsj").replace(/-/g,'/');
            if(fxsj==''){
                FR_MAIN.setData('m:cdwd:sfyssb','否');
            }
            if(kssbs!=''){
                kssbs=new Date(kssbs).getTime();
                fxsj=new Date(fxsj).getTime();
                if((kssbs-fxsj)>(15*60000)){
                    FR_MAIN.setData('m:cdwd:sfyssb','是');
                }else{
                    FR_MAIN.setData('m:cdwd:sfyssb','否');
                }
            }else{
                sbsj=new Date(sbsj).getTime();
                fxsj=new Date(fxsj).getTime();
                if((sbsj-fxsj)>(60*60000)){
                    FR_MAIN.setData('m:cdwd:sfyssb','是');
                }else{
                    FR_MAIN.setData('m:cdwd:sfyssb','否');
                }
            }
            FR_MAIN.setDisplay('m:cdwd:sfyssb',false);
        }
        FR_MAIN.setDisplay('m:cdwd:zrdq',false);
        FR_MAIN.setDisplay('m:cdwd:zbID',false);

        function init(){
            setycbt();
            setcshycdj();
            setsfyssb();
        }
        init();

        var fieldChange = {
            //设置异常标题
            "m:cdwd:sbsj" : function(key, val, item, obj) {
                setycbt();
                //设置延迟上报
                setsfyssb();
            },
            "m:cdwd:yccldq" : function(key, val, item, obj) {
                setycbt();
				setValue_area(val,item);
            },
            "m:cdwd:ycclwd" : function(key, val, item, obj) {
                setycbt();
				setValue_dept(val,item);
            },
            //设置延迟上报
            "m:cdwd:kssbsj" : function(key, val, item, obj) {
                setsfyssb();
            },
            "m:cdwd:fxsj" : function(key, val, item, obj) {
                setsfyssb();
            },
        };
		
		//处理地区
		function setValue_area(val,item) {
			var typeLevel = item['typeLevel'];
			if(typeLevel != 2){  
					FR_MAIN.setData('m:cdwd:yccldqPATH','');
					FR_MAIN.setData('m:cdwd:yccldqID','');
					FR_MAIN.setData('m:cdwd:yccldq','');
					FR_MAIN.$notify.error({
						title: '提示',
						message: '请选择地区层级代码'
				});
				return;
			}else{
				setycbt();
			}
		}
		//处理网点
		function setValue_dept(val,item) {
			var typeLevel = item['typeLevel'];
			if(typeLevel < 3){
				FR_MAIN.setData('m:cdwd:ycclwdPATH','');
				FR_MAIN.setData('m:cdwd:ycclwdID','');
				FR_MAIN.setData('m:cdwd:ycclwd','');
				FR_MAIN.$notify.error({
				title: '提示',
				message: '请选择网点层级代码'
				});
				return;
			}
		}
        // 表单改变
        window.FormChange = Object.assign({}, fieldChange);
    })</script>